package com.atguigu.springcloud.alibaba.service;

import com.atguigu.springcloud.alibaba.domain.CommonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * FeignClient调用库存2002
 * 订单微服务调用库存微服务
 */
@FeignClient(value = "seata-storage-service")
public interface StorageService {

    // 减库存 (找到微服务seata-storage-service下的decrease方法)
    @PostMapping(value = "/storage/decrease")
    CommonResult decrease(@RequestParam("productId") Long productId,@RequestParam("count") Integer count);

}
